package com.leon.dao;

import com.leon.pojo.Address;
import com.leon.pojo.Person;
import org.bson.types.ObjectId;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;

/**
 * @description:
 * @program: mytanhua
 * @author: Leon
 * @date: 2021-01-29 19:19
 **/
@SpringBootTest
@RunWith(SpringRunner.class)
public class testDao {

    @Autowired
    private PersonDao personDao;

    @Test
    public void testSavePersonD(){
        personDao.savePerson(new Person(ObjectId.get(),"zhangsan",23,new Address("kjdfi","kan","ajgoj")));
    }

    @Test
    public void testFindAll(){
        List<Person> all = personDao.findAll();
        for (Person o : all) {
            System.out.println(o.toString());
        }
    }


}
